<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
    <title>Search{% if query %} Results{% endif %}</title>
</head>
<body>
  <h1>Browse data</h1>
  <a href="/reaction/">Reactions</a> <br/>
  <a href="/compound/">Compounds</a><br/>
  <a href="/gene/">Genes</a><br/>
  <h1>Search data</h1>
  Search reactions by reactionid, compound id, compound name, gene name or EC number (case insensitive) <br/>
  <form action="." method="GET">
    <label for="q">Search reaction: </label>
    <input type="text" name="q" value="{{ query|escape }}">
    <input type="submit" value="Search">
  </form>

  {% if query %}
    <h2>Results for "{{ query|escape }}":</h2>

    {% if results %}
      <table cellspacing="0">
	    <thead>
		    <tr>
			    <th>Reactionid</th>
			    <th>Pathway</th>
			    <th>Reversibility</th>
			    <th>Equation</th>
	   	    </tr>
           </thead>
           <tbody>
              {% for rea in results %}
	      <tr>
		      <th><a href="../reaction/{{rea.reactionid}}/">{{ rea.reactionid}}</a></th>
		      <td>{{rea.pathway}}</td>
		      <td>{{rea.reversibility}}</td>
		      <td>{{rea.equation}}</td>
	      </tr>
             {% endfor %}
          </tbody>
      </table>
    {% else %}
      <p>No reaction found</p>
    {% endif %}
  {% endif %}
</body>
</html>
